import 'package:flutter/material.dart';
import 'package:stream_player/router/livePush/livePush.dart';
import 'package:stream_player/router/liveReceive/liveReceive.dart';
import 'utils/PhonePermissionUtils.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    PhonePermissionUtils.checkPermission().then((onValue) {});
    return MaterialApp(
      home: Builder(
        builder: (context) => Scaffold(
          appBar: AppBar(
            title: const Text('flutter 推流 收流'),
          ),
          body: Center(
            child: ListView(
              children: <Widget>[
                RaisedButton(
                  onPressed: () {
                    Navigator.push(context,
                        MaterialPageRoute(builder: (context) => LivePush()));
                  },
                  child: Text("直播"),
                ),
                RaisedButton(
                  onPressed: () {
                    Navigator.push(context,
                        MaterialPageRoute(builder: (context) => LiveReceive()));
                  },
                  child: Text("观看"),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
